package com.ruoyi.hospital.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.hospital.mapper.HosBunkMapper;
import com.ruoyi.hospital.domain.HosBunk;
import com.ruoyi.hospital.service.IHosBunkService;

/**
 * 床位信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-01-06
 */
@Service
public class HosBunkServiceImpl implements IHosBunkService 
{
    @Autowired
    private HosBunkMapper hosBunkMapper;

    /**
     * 查询床位信息
     * 
     * @param bunkId 床位信息主键
     * @return 床位信息
     */
    @Override
    public HosBunk selectHosBunkByBunkId(Long bunkId)
    {
        return hosBunkMapper.selectHosBunkByBunkId(bunkId);
    }

    /**
     * 查询床位信息列表
     * 
     * @param hosBunk 床位信息
     * @return 床位信息
     */
    @Override
    public List<HosBunk> selectHosBunkList(HosBunk hosBunk)
    {
        return hosBunkMapper.selectHosBunkList(hosBunk);
    }

    /**
     * 新增床位信息
     * 
     * @param hosBunk 床位信息
     * @return 结果
     */
    @Override
    public int insertHosBunk(HosBunk hosBunk)
    {
        hosBunk.setBunkId(System.currentTimeMillis());
        return hosBunkMapper.insertHosBunk(hosBunk);
    }

    /**
     * 修改床位信息
     * 
     * @param hosBunk 床位信息
     * @return 结果
     */
    @Override
    public int updateHosBunk(HosBunk hosBunk)
    {
        return hosBunkMapper.updateHosBunk(hosBunk);
    }

    /**
     * 批量删除床位信息
     * 
     * @param bunkIds 需要删除的床位信息主键
     * @return 结果
     */
    @Override
    public int deleteHosBunkByBunkIds(Long[] bunkIds)
    {
        return hosBunkMapper.deleteHosBunkByBunkIds(bunkIds);
    }

    /**
     * 删除床位信息信息
     * 
     * @param bunkId 床位信息主键
     * @return 结果
     */
    @Override
    public int deleteHosBunkByBunkId(Long bunkId)
    {
        return hosBunkMapper.deleteHosBunkByBunkId(bunkId);
    }
}
